using System;
using GoogleEarthClasses.Entities;
using System.Collections.Generic;

namespace GoogleEarthClasses.Entities
{
    [Serializable]
    public class EPoint : IComparable<EPoint>
    {
        #region Private Members
        Int32 m_LocationId;
        string m_Description;
        double m_Latitude;
        double m_Longitude;
        double m_Altitude;
        DateTime m_SatelliteTime;
        Int32 m_Satellites;
        double m_Angle;
        string m_Name;
        List<EImage> m_Images;
        Int32 m_HaveImages;
        Int32 m_InsertedPosition;
        string  m_Color;
        string  m_Icon;
        EPoint m_ParentPoint;
        #endregion Private Members

        #region Properties

        public Int32 LocationId
        {
            get{return m_LocationId;}
            set{m_LocationId = value;}
        }
        public string Description
        {
            get{return m_Description;}
            set{m_Description = value;}
        }
        public double Latitude
        {
            get{return m_Latitude;}
            set{m_Latitude = value;}
        }
        public double Longitude
        {
            get{return m_Longitude;}
            set{m_Longitude = value;}
        }
        public double Altitude
        {
            get{return m_Altitude;}
            set{m_Altitude = value;}
        }
        public string Name
        {
            get{return m_Name;}
            set{m_Name = value;}
        }
        public List<EImage> Images
        {
            get{return m_Images;}
            set{m_Images = value;}
        }
        public Int32 Satellites
        {
            get { return m_Satellites; }
            set { m_Satellites = value; }
        }
        public DateTime SatelliteTime
        {
            get { return m_SatelliteTime; }
            set {m_SatelliteTime = value;}
        }
        public double Angle
        {
            get { return m_Angle; }
            set { m_Angle = value; }
        }
        public Int32 HaveImages
        {
            get { return m_HaveImages; }
            set { m_HaveImages = value; }
        }
        public Int32 InsertedPosition
        { 
            set{m_InsertedPosition = value;}
            get{return m_InsertedPosition;}
            
        }
        public string Color
        {
            set { m_Color = value; }
            get { return m_Color; }

        }
        public string Icon
        {
            set { m_Icon = value; }
            get { return m_Icon; }
        }
        public EPoint ParentPoint
        {
            set { m_ParentPoint = value; }
            get { return m_ParentPoint; }
        }

        
        #endregion Properties

        #region Constructors
        public EPoint()
        {
            m_Images = new List<EImage>();
        }
        public EPoint(Int32 LocationId)
        {
            m_LocationId = LocationId;
        }
        public EPoint(Int32 LocationId, double Latitude, double Longitude, double Altitude, string Description)
        {
            m_LocationId = LocationId;
            m_Latitude = Latitude;
            m_Longitude = Longitude;
            m_Altitude = Altitude;
            m_Description = Description;
            
        }
        public EPoint(Int32 LocationId, double Latitude, double Longitude, double Altitude, string Description, double Angle, Int32 Satellites, DateTime SatelliteTime, Int32 InsertedPosition)
            :this(LocationId,Latitude,Longitude,Altitude,Description)
        {
            m_Angle = Angle;
            m_Satellites = Satellites;
            m_SatelliteTime = SatelliteTime;
            m_HaveImages = m_Images.Count;
            m_InsertedPosition = InsertedPosition;
        }

        public EPoint(Int32 LocationId, double Latitude, double Longitude, double Altitude, string Description, double Angle, Int32 Satellites, DateTime SatelliteTime, Int32 InsertedPosition, string Color)
            : this(LocationId, Latitude, Longitude, Altitude, Description)
        {
            m_Angle = Angle;
            m_Satellites = Satellites;
            m_SatelliteTime = SatelliteTime;
            m_HaveImages = m_Images.Count;
            m_InsertedPosition = InsertedPosition;
            m_Color = Color;
        }

        #endregion Constructors

        #region IComparable<EPoint> Members

        public int CompareTo(EPoint other)
        {
            return this.HaveImages.CompareTo(other.HaveImages);
        }

        #endregion
    }
}

